home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / flilib.zip / FLISRC.ZIP / GETDIR.C < prev    next >
C/C++ Source or Header  |  1989-11-16  |  515b  |  24 lines

  1.  
  2. #include "aai86.h"
  3. #include "aados.h"
  4.  
  5. /* Get the current device and directory into path */
  6. Boolean dos_get_dir (char path[DOS_PATH_SIZE])
  7. {
  8. union i86_regs reg;
  9. char buf[DOS_PATH_SIZE];
  10. int d;
  11.  
  12. if ((d = dos_get_dev ()) < 0)
  13.     return(FALSE);
  14. reg.b.ah = 0x47;
  15. reg.b.dl = 0;    /* default device ... */
  16. reg.b.si = i86_ptr_offset(buf);
  17. reg.b.ds = i86_ptr_seg(buf);
  18. if (i86_sysint(0x21, ®, ®)&1)    /* check carry for error */
  19.     return(FALSE);
  20. sprintf(path,"%c:\\%s", d+'A', buf);
  21. return(TRUE);
  22. }
  23.  
  24.